package com.wetao.testkotlin

import java.lang.StringBuilder

val F_A = "STATIC FINAL DATA"
fun <T> Collection<T>.joinToString(
                      separator: String = ",",
                      prefix: String = "",
                      postfix: String = ""): String{
    val result = StringBuilder(prefix)
    for((index, element) in this.withIndex()) {
        if(index > 0) result.append(separator)
        result.append(element)
    }
    result.append(postfix)
    return result.toString()
}


fun String.lastChar():Char=this.get(length - 1)
